package Model;

/**
 * Defense player class
 * @author Jose Filipe M Santos - 7277502
 * @author Matheus Martins Teixeira - 7277482
 */
public class PlayerDef extends Player implements PlayerField{

    private int Cover;
    private int Challenge;
    private int Goals;

    /**
     * PlayerDef's constructor (only one)
     *
     * @param pName  Player's name
     * @param pAge   Player's age
     * @param pHab   Player's general hability
     * @param pCover Player's cover (specific to defense players)
     * @param pChall Player's challenge (specific to defense players)
     */
    public PlayerDef(String pName, int pAge, int pHab, int pCover, int pChall){

        super(pName, pAge, pHab);
        this.Cover = pCover;
        this.Challenge = pChall;
        this.Goals = 0;

    }

    /**
     * Returns defense player's specifi hability ((cover * 3 + general hability * 5 + challenge * 2) / 10)
     *
     * @return Defense player's hability
     */
    @Override
    public int getHability(){

        int Hab = super.getHability();
        return ( ((this.Cover * 3)  + (Hab * 5) + (this.Challenge * 2)) / 10  );

    }

    /**
     * Returns the player's challenge (specific to defense players)
     *
     * @return Defense player's challenge
     */
    public int getChallenge() {
	return Challenge;
    }

    /**
     * Returns the player's cover (specific to defense player)
     *
     * @return Defense Player's challenge
     */
    public int getCover() {
	return Cover;
    }

    /**
     * Returns the number of goals given to the defense player
     *
     * @return number of goals
     */
    @Override
    public int getGoals(){
        return Goals;
    }

    /**
     * Sum 1 to the current defense player goals record
     */
    @Override
    public void sumGoal(){

        this.Goals++;

    }

}
